﻿<UserControl x:Class="TreeBuilder.DragButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="150" d:DesignWidth="150">
    <UserControl.Resources>
        <DrawingBrush x:Key="Inactive" Stretch="Fill"  TileMode="None"
                      Viewbox="0,0,100,100" ViewboxUnits="RelativeToBoundingBox"
                      Viewport="0,0,100,100" ViewportUnits="RelativeToBoundingBox">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <GeometryDrawing Brush="White">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Silver" Thickness="13"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <RectangleGeometry Rect="0,0,100,100" />
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                    <GeometryDrawing Brush="Black">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Black" Thickness="2"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <GeometryGroup>
                                <LineGeometry StartPoint="0,50" EndPoint="100,50"/>
                                <LineGeometry StartPoint="50,0" EndPoint="50,100"/>
                                <PathGeometry FillRule="Nonzero">
                                    <PathFigure StartPoint="0,50" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="30,37"/>
                                        <LineSegment Point="30,63"/>
                                    </PathFigure>
                                    <PathFigure StartPoint="50,0" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="37,30"/>
                                        <LineSegment Point="63,30"/>
                                    </PathFigure>
                                    <PathFigure StartPoint="50,100" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="37,70"/>
                                        <LineSegment Point="63,70"/>
                                    </PathFigure>
                                    <PathFigure StartPoint="100,50" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="70,37"/>
                                        <LineSegment Point="70,63"/>
                                    </PathFigure>
                                </PathGeometry>
                            </GeometryGroup>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>
        <DrawingBrush x:Key="Active" Stretch="Fill"  TileMode="None"
                      Viewbox="0,0,100,100" ViewboxUnits="RelativeToBoundingBox"
                      Viewport="0,0,100,100" ViewportUnits="RelativeToBoundingBox">
            <DrawingBrush.Drawing>
                <DrawingGroup>
                    <GeometryDrawing Brush="White">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Orange" Thickness="13"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <RectangleGeometry Rect="0,0,100,100" />
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                    <GeometryDrawing Brush="Black">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Black" Thickness="2"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <GeometryGroup>
                                <LineGeometry StartPoint="0,50" EndPoint="100,50"/>
                                <LineGeometry StartPoint="50,0" EndPoint="50,100"/>
                                <PathGeometry FillRule="Nonzero">
                                    <PathFigure StartPoint="0,50" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="30,37"/>
                                        <LineSegment Point="30,63"/>
                                    </PathFigure>
                                    <PathFigure StartPoint="50,0" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="37,30"/>
                                        <LineSegment Point="63,30"/>
                                    </PathFigure>
                                    <PathFigure StartPoint="50,100" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="37,70"/>
                                        <LineSegment Point="63,70"/>
                                    </PathFigure>
                                    <PathFigure StartPoint="100,50" IsFilled="True" IsClosed="True">
                                        <LineSegment Point="70,37"/>
                                        <LineSegment Point="70,63"/>
                                    </PathFigure>
                                </PathGeometry>
                            </GeometryGroup>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingGroup>
            </DrawingBrush.Drawing>
        </DrawingBrush>
        <Style x:Key="ButtonStyle" TargetType="Rectangle">
            <Setter Property="Fill" Value="{StaticResource Inactive}"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Fill" Value="{StaticResource Active}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Rectangle Name="Rectangle" Style="{StaticResource ButtonStyle}"/>
</UserControl>
